package io.github.junxworks.junx.core.util;

public class Asserts {
	private Asserts() {
	}

	public static void check(final boolean expression, final String message) {
		if (!expression) {
			throw new IllegalStateException(message);
		}
	}

	public static void check(final boolean expression, final String message, final Object... args) {
		if (!expression) {
			throw new IllegalStateException(String.format(message, args));
		}
	}

	public static void notNull(final Object object, final String name) {
		if (object == null) {
			throw new IllegalStateException(name + " is null");
		}
	}
}
